package com.base.common.model.po;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author yuzhongbo
 * @date 2020/5/11 PM5:46
 */
@Data
@ApiModel(value = "Permission对象", description = "")
@JsonIgnoreProperties(ignoreUnknown = true)
public class PermissionPo implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "权限名称")
    @NotBlank
    private String permissionName;

    @ApiModelProperty(value = "权限状态")
    @NotBlank
    private String permissionState;

    @ApiModelProperty(value = "权限类型0文件夹1菜单2按钮3数据")
    @NotBlank
    private String permissionType;

    @ApiModelProperty(value = "权限URL")
    private String permissionUrl;

    @ApiModelProperty(value = "权限key")
    private String permissionKey;

    @ApiModelProperty(value = "权限value")
    private String permissionValue;

    @ApiModelProperty(value = "权限的父级")
    @NotBlank
    private Long parentId;

    @ApiModelProperty(value = "权限序号")
    @NotNull
    private Integer permissionSoftnum;

    @ApiModelProperty(value = "权限是否可见 1是 0否")
    @NotBlank
    private String dispalyFlag;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "所属系统")
    @NotBlank
    private String btSystem;

    @ApiModelProperty(value = "所属用户")
    private String btUser;

    @ApiModelProperty(value = "数据子权限")
    public PermissionPo dataPermission;

    @ApiModelProperty(value = "按钮子权限")
    public List<PermissionPo> buttonPermissions = new ArrayList<>();

    @ApiModelProperty(value = "权限图标")
    private String permissionIcon;
}